<script>
	


	export default {
		methods: {
			
		},
		onLaunch: function() {
			console.log('App Launch')
			this.globalData = {}; // 初始化全局数据
			

			let imManager = require("./pages/index/utils/im-manager.js");
			let loginInfo = uni.getStorageSync('loginInfo');
			if (loginInfo && loginInfo != null && loginInfo != '' && loginInfo != 0) {
				uni.IMSDK.loginImpl(loginInfo, imManager.IM_SERVER_URL, false);

			

			} else {
				uni.setStorageSync('loginInfo', {});
				uni.setStorageSync('token', '')
				uni.setStorageSync('user_uid', '')
				uni.setStorageSync('userId', '')
				uni.setStorageSync('user_level', '')
				uni.setStorageSync('nickname', '')
				uni.setStorageSync('user_avatar_file_name', '')
				uni.setStorageSync('loginInfoArr', []);
				uni.IMSDK.disconnectSocket();
				uni.MBSocketProvider.closeLocalSocket();
				// uni.reLaunch({
				// 	url:'/pages/login'
				// })
			}
		},
		onShow: function() {
			console.log('App Launch')
			// this.getdata();
			this.globalData = {}; // 初始化全局数据

			let imManager = require("./pages/index/utils/im-manager.js");
			let loginInfo = uni.getStorageSync('loginInfo');
			if (loginInfo && loginInfo != null && loginInfo != '' && loginInfo != 0) {
				uni.IMSDK.loginImpl(loginInfo, imManager.IM_SERVER_URL, false);
			} else {
				uni.setStorageSync('loginInfo', {});
				uni.setStorageSync('token', '')
				uni.setStorageSync('user_uid', '')
				uni.setStorageSync('userId', '')
				uni.setStorageSync('user_level', '')
				uni.setStorageSync('nickname', '')
				uni.setStorageSync('user_avatar_file_name', '')
				uni.setStorageSync('loginInfoArr', []);
				uni.IMSDK.disconnectSocket();
				uni.MBSocketProvider.closeLocalSocket();
				// uni.reLaunch({
				// 	url:'/pages/login'
				// })
			}
		},
		onHide: function() {

		}
	}
</script>

<style lang="scss">
	@import url("static/css/base.css");
	@import "uview-ui/index.scss";

	html,
	body {
		font-family: cursive !important;
		/* 替换为你的字体 */
	}

	uni-scroll-view,
	uni-swiper,
	uni-swiper-item,
	uni-view,
	uni-text,
	uni-input,
	uni-textarea {
		margin: 0;
		padding: 0;
		color: #333;
		font-size: 14px;
		box-sizing: border-box;
		font-family: cursive;
	}

	::v-deep.uni-tabbar-border {
		width: 100%;
		background-color: #fff;
		// margin-top: 18upx;
		// border-radius: 20upx;
		// padding: 20upx 30upx;
		box-shadow: 0 0 3px #f9f9f9 !important; // 左
		//box-shadow: 0 0 40upx #f9f9f9; // 右
	}
</style>